package com.lei.zjs.service.ebo;

import java.util.List;

import javax.annotation.Resource;

import org.hibernate.criterion.DetachedCriteria;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.lei.zjs.dao.DecidezoneDao;
import com.lei.zjs.service.ebi.DecidezoneService;
import com.lei.zjs.vo.Decidedzone;
import com.lei.zjs.vo.PageBean;
import com.lei.zjs.vo.Staff;
import com.lei.zjs.vo.Subarea;

/**
 * 定区管理service实现类
 * @author Spinacia
 *
 */
@Service
@Transactional
public class DecidezoneServiceImpl implements DecidezoneService{

	@Resource
	private DecidezoneDao decidezoneDao;
	@Resource
	private SubareaDao subareaDao;

	@Override
	public void save(Decidedzone model, String[] subareaids) {
		decidezoneDao.save(model);
		//让分区与定区建立关系
		for (String subareaid : subareaids) {
			Subarea subarea = subareaDao.findById(subareaid);
			subarea.setDecidedzone(model);
		}
	}

	@Override
	public void pageQuery(PageBean pageBean) {
		decidezoneDao.pageQuery(pageBean);
	}

}
